def binaryToDecimal(binaryString):
    result = 0
    for i in range(0,len(binaryString)):
        a = binaryString[i]

        result += eval(a) * pow(2,len(binaryString) - i - 1)
    print('The decimal value is',result)

binaryToDecimal(input())